package com.moo2u2.android.oaktononthego.locate.dao;

import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

public class ColleagueTable {

	private static final String DATABASE_CREATE = "create table "
			+ ColleagueDbAdapter.DB_TABLE + "(" + ColleagueDbAdapter.KEY_ROWID
			+ " integer primary key autoincrement, "
			+ ColleagueDbAdapter.KEY_NAME + " text not null, "
			+ ColleagueDbAdapter.KEY_IMG + " text not null, "
			+ ColleagueDbAdapter.KEY_LONGITUDE + " text not null, "
			+ ColleagueDbAdapter.KEY_LATITUDE + " text not null);";

	public static void onCreate(SQLiteDatabase database) {
		database.execSQL(DATABASE_CREATE);
	}

	public static void onUpgrade(SQLiteDatabase database, int oldVersion,
			int newVersion) {
		Log.w(ColleagueTable.class.getName(), "Upgrading database from version "
				+ oldVersion + " to " + newVersion
				+ ", which will destroy all old data");
		database.execSQL("DROP TABLE IF EXISTS " + ColleagueDbAdapter.DB_TABLE);
		onCreate(database);
	}
}